package lab02.test34;

import java.util.ArrayList;
import java.util.List;

public class Test34 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();
        //在列表中输入数据
        list.add("apple");
        list.add("grape");
        list.add("banana");
        list.add("pear");

        Object[] arr = list.toArray();

        System.out.println("最小元素："+arr[0]);
        System.out.println("最大元素："+arr[arr.length-1]);

        for (Object h: arr){
            System.out.println(h);
        }

    }
}
